﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administrator/EHTAdmin.Master" AutoEventWireup="true" CodeBehind="EHTArticleIU.aspx.cs" Inherits="EHTWebsiteProject.Administrator.EHTArticleIU" %>

<%@ Register Assembly="FreeTextBox" Namespace="FreeTextBoxControls" TagPrefix="FreeTextBox" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
 <script type="text/javascript" language="JavaScript">

     function GetRadWindow() {
         var oWindow = null;
         if (window.radWindow) oWindow = window.radWindow;
         else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
         return oWindow;
     }

     function doUpload() {
         //            var res = Sharing_UploadFiles.Upload();
         //            var oArg = new Object();
         //            oArg.GroupID = res.value;
         //            var oWnd = GetRadWindow();
         //            oWnd.close(oArg);
     }
        
    </script>
   
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MenuModulContent" runat="server">
     <div class="MenuSub-Left" >
        <table>
            <tr>
                <td> <img alt="" src="../images/EHTgiaodien/icon-48-article-add.png" /></td>
                <td><asp:Label ID="lbAdd_Edit"  runat="server" Text="Thêm" ></asp:Label></td>
                <td><asp:Label ID="lbArticles" runat="server" Text="bài viết" ></asp:Label></td>                
            </tr>
        </table>           
    </div>
    <div class="MenuSub-Right" align="right">
        <table style="height:60px">
            <tr>                               
               <td valign="middle">
                    <div class="add-edit-del">
                            <asp:ImageButton ID="ImgSave" 
                                ImageUrl="~/images/EHTgiaodien/icon-32-revert.png" runat="server" width="32px" 
                                height="32px" class="imagboder" onclick="ImgSave_Click" />
                            <br />
                            <asp:Label ID="lbSave" runat="server" Text="Lưu"></asp:Label>
                        
                    </div>
                </td>
                <td valign="middle">
                    <div class="add-edit-del">
                            <asp:ImageButton ID="ImgApply" 
                                ImageUrl="~/images/EHTgiaodien/icon-16-checkin.png" runat="server" width="32px" 
                                height="32px" class="imagboder" onclick="ImgApply_Click" />
                            <br />
                            <asp:Label ID="lbApply" runat="server" Text="Áp dụng"></asp:Label>
                        
                    </div>
                </td>
                <td valign="middle">
                    <div class="add-edit-del">
                        <a href="EHTArticle.aspx">
                            <img alt="" src="../images/EHTgiaodien/icon-32-cancel.png" width="32px" height="32px" class="imagboder" /><br />
                            <asp:Label ID="lbCancel" runat="server" Text="Hủy"></asp:Label>
                        </a>
                    </div>
                </td>
                 <td valign="middle">
                    <div class="add-edit-del">
                        <a href="#">
                            <img alt="" src="../images/EHTgiaodien/icon-32-help.png" width="32px" height="32px" class="imagboder" /><br />
                            <asp:Label ID="lbHelp" runat="server" Text="Trợ giúp"></asp:Label>
                        </a>
                    </div>
                </td>                
            </tr>
        </table>
    </div>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ContentMain" runat="server">
<script type="text/javascript">
    function getSel() {
        var editor = $find("<%=RadNoiDUngVN.ClientID %>");
        var str = editor.get_text();
        var selection = editor.getSelection();

        //get the selected text:
        var selectedText = selection.getText();

        if (selectedText) {
            if (str.search('-------') == -1)
                editor.pasteHtml(selectedText + '-------<br/>');
            else
                alert('Bạn đã lựa chọn nội dung tóm tắt');

        }

        else

            alert('Phải lựa chọn nội dung tóm tắt');


    }        

</script>
<script type="text/javascript">
    function getSelOther() {
        var editor = $find("<%=RadNoiDungOther.ClientID %>");
        var str = editor.get_text();
        var selection = editor.getSelection();

        //get the selected text:
        var selectedText = selection.getText();

        if (selectedText) {
            if (str.search('-------') == -1)
                editor.pasteHtml(selectedText + '-------<br/>');
            else
                alert('Bạn đã lựa chọn nội dung tóm tắt');

        }

        else

            alert('Phải lựa chọn nội dung tóm tắt');


    }
    
</script>
<asp:Literal ID="ltrErorr" runat="server"></asp:Literal>

<div style="padding-top:10px">
    <table cellspacing="0" cellpadding="0" class="table-Add" style="width:100%">
            <tbody>                     
                <tr>
                    <td align="left">
                        <asp:Label ID="lbDanhMucTinTuc" runat="server">Danh Mục Tin Tức:</asp:Label>
                    </td>
                    <th colspan="2" align="left">
                        <asp:DropDownList ID="ddlDanhMucTinTuc" runat="server" CssClass="InputText">
                        </asp:DropDownList>
                        <asp:RequiredFieldValidator ID="rvDanhMucTinTuc" runat="server" ControlToValidate="ddlDanhMucTinTuc"
                            ValidationGroup="NewsGroup" CssClass="failureNotification" ErrorMessage="Hãy chọn chuên mục."
                            InitialValue="-1" ToolTip="Hãy chọn chuyên mục." Text="*" />
                    </th>
                </tr>

                <tr>
                    <td align="left" >
                        <asp:Label ID="lbMenuNameVN" runat="server">Tiêu đề (VN)</asp:Label>
                    </td>
                    <th align="left" colspan="2">
                        <asp:TextBox ID="txtTieuDeVN" runat="server" CssClass="InputText"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rvTieuDeVN" runat="server" ErrorMessage="Tiêu để VN không được để trống."
                            ControlToValidate="txtTieuDeVN" Text="*" CssClass="failureNotification" ToolTip="Tiêu để VN không được để trống."
                            ValidationGroup="NewsGroup" />
                    </th>
                   
                </tr>
                <tr>
                     <td align="left" >
                         <asp:Label ID="lbMenuNameOther" runat="server">Tiêu Đề (Other)</asp:Label>
                    </td>
                    <th align="left" colspan="2">
                         <asp:TextBox ID="txtTieuDeOther" runat="server" CssClass="InputText"></asp:TextBox>
                        <asp:RequiredFieldValidator ID="rvTieuDeOther" runat="server" ValidationGroup="NewsGroup"
                            ControlToValidate="txtTieuDeOther" CssClass="failureNotification" ErrorMessage="Tiêu để Other không được để trống."
                            ToolTip="Tiêu để Other không được để trống." Text="*" />
                    </th>
                </tr>
                 <tr>
                    <td align="left" valign="bottom">
                        <asp:Label ID="lbHinhAnh" runat="server">Hình Ảnh:</asp:Label>
                    </td>
                    <th valign="bottom" colspan="2" align="left">
                        <div style="padding:5px 0px 5px 10px">
                            
                            <asp:Image ID="imgHinhAnh" runat="server" BorderWidth="0" Height="150px" Width="150px" />
                            <asp:TextBox ID="txtImage" runat="server" Visible="false"></asp:TextBox>
                        </div>
                        <br />
                        <asp:FileUpload ID="fuHinhAnhUrl" runat="server"  /> 
                        <asp:Button ID="btnUpload" runat="server" Text="UpLoad" CssClass="btnLogin" 
                            onclick="btnUpload_Click" />                      
                    </th>
                     
                </tr>               
                 <tr>
                    <td align="left" valign="bottom">
                        <asp:Label ID="lbThuTu" runat="server">Sắp Xếp:</asp:Label>
                    </td>
                    <th valign="bottom" colspan="2" align="left">
                        <asp:TextBox ID="txtSapXep" runat="server" CssClass="textEntry">1</asp:TextBox>
                    </th>
                     
                </tr>                          
                <tr>
                    <td>
                    </td>
                    <th colspan="2" align="left">
                        <asp:CheckBox ID="chkNoiBat" runat="server" Text="Tin Nổi bật" />                       
                    </th>
                </tr>   
                                                                   
                <tr>
                    <th align="right" colspan="2">
                        <asp:Label ID="lbNoiDungVN" runat="server">Nội Dung (VN):</asp:Label>
                    </th>
                    <th align="right">
                        &nbsp;</th>                    
                </tr>
                <tr class="OtherLanguage">
                    <th colspan="2">
                                             
                    </th>
                    <th>
                                  
                        <telerik:RadEditor ID="RadNoiDUngVN" runat="server" Height="600" Width="100%">
                            <ImageManager ViewPaths="~/ImageDatas/News" />
                        </telerik:RadEditor>
                        <div>
                             <%if (IsVN)
                                 { %>
                                     <input onclick="getSel();return false;" type="Button" 
                                value="Đọc thêm" />
                                 <%}
                             else
                                 {%>
                                     <input onclick="getSel();return false;" type="Button" 
                                value="Read More" />
                                 <%}
                              %>                                                                
                          
                            </div>
                                  
                    </th>
                </tr>
                                      
                <tr class="OtherLanguage">
                    <th colspan="2">
                                             
                        <asp:Label ID="lbNoiDungOther" runat="server">Nội Dung (Other):</asp:Label>
                    </th>
                    <th>
                                  
                        <telerik:RadEditor ID="RadNoiDungOther" runat="server" Height="600px" 
                            Width="100%">
                            <ImageManager ViewPaths="~/ImageDatas/News" />
                        </telerik:RadEditor>
                        <div>
                          
                           <%if (IsVN)
                                 { %>
                                    <input onclick="getSelOther();return false;" type="Button" 
                                value="Đọc thêm" />
                                 <%}
                             else
                                 {%>
                                     <input onclick="getSelOther();return false;" type="Button" 
                                value="Read More" />
                                 <%}
                              %>     
                        </div>
                    </th>
                </tr>
                                      
                <tr class="OtherLanguage">
                    <th colspan="3" align="center">
                          <div style="display:table;width:100%">
                        <div style="width:48%;text-align:center;float:left">
                        </div>
                        <div style="width:48%;text-align:center;float:left">
                           
                        </div>
                        </div>                   
                        &nbsp;</th>
                </tr>
                                      
            </tbody>
        </table>
</div>
</asp:Content>
